package com.sixbing.demo.model;


import com.company.module.net.RetrofitUtil;
import com.company.module.net.bean.BaseBean;
import com.sixbing.demo.base.BaseHttpApi;
import com.company.module.net.utils.RequestBodyUtil;
import com.sixbing.demo.bean.AppVersionNetBean;

import java.util.HashMap;
import java.util.Map;

import io.reactivex.Observable;

/**
 * @author sixbing
 * @date 2018/10/29 14:59
 * description :
 */

public class AppModel extends BaseModel {
    private BaseHttpApi baseHttpApi;

    public AppModel() {
        baseHttpApi = RetrofitUtil.getInstance().getHttpApi(BaseHttpApi.class);
    }

    /**
     * 登录
     */
    public Observable<BaseBean<AppVersionNetBean>> checkUpdate() {
        Map<String, Object> params = new HashMap<>();
        //app类型
        params.put("app", "1");
        //受众
        params.put("audience", "1");
        //版本号
        params.put("version", "4");
        return observe(baseHttpApi.checkUpdate(RequestBodyUtil.getBody(params)));
    }


}
